/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Lab_v3;
import java.util.Hashtable;
import java.util.Enumeration;
import java.util.ArrayList;
import java.sql.Array;

/**
 *
 * @author salman
 */
public class MCQModel {


    private Hashtable object_hastable;
    private dbtables_test_metadata dbobject_test_metadata;
    private dbtables_question_metadata dbobject_question_metadata;
    private dbtables_mcq_options dbobject_mcq_options;

    public MCQModel ()
    {
        object_hastable = new Hashtable();
         
        dbobject_test_metadata =  new dbtables_test_metadata("sqlite","mcqTest.db");
        dbobject_question_metadata =  new dbtables_question_metadata("sqlite","mcqTest.db");
        dbobject_mcq_options =  new dbtables_mcq_options("sqlite","mcqTest.db");

      // Hashtable test_data= dbobject_test_metadata.getAllTests();
 //Hashtable test_data=dbobject_mcq_options.getAllMCQOptions();
//Hashtable test_data=dbobject_question_metadata.getQuestion("1","1");
Hashtable test_data=dbobject_mcq_options.getAllRightAnswers("1");
        System.out.println("Retrieving all values from the Hashtable");
  //System.out.println("Hashtable contains " + test_data.size() + " key value pairs.");
       Enumeration e = test_data.elements();
ArrayList a =new ArrayList();
//System.out.println(test_data.get("question_number"));
//System.out.println(test_data.get(1));
        while(e. hasMoreElements()){
System.out.println(e.nextElement());
//a =(ArrayList) e.nextElement();
        }
////ab=(ArrayList) e.nextElement();
//       //    a =(ArrayList) e.nextElement();
//        //   System.out.println(a);
//            //System.out.println(a.get(0));
//         //s ArrayList a = e.nextElement();
//        }

//        object_hastable.put("One", new Integer(1)); //adding value to Hashtable
//
//
//
//object_hastable.put("Two", new Integer(2));
//
//
//
//object_hastable.put("Three", new Integer(3));
//
//
//        System.out.println("Hashtable contains " + object_hastable.size() + " key value pairs.");
    }

//    public Hashtable setTest(int test_number)
//    {
//
//        return 1;
//    }
}
